﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace LdtJudge.DataEngine.Model.XMLConfigModel.OptimizeConfigModel
{
    /// <summary>
    /// 要素优选数据源配置
    /// </summary>
    [Serializable]
    [XmlRootAttribute("sourcedata", IsNullable = false)]
    public class OptimizeFactData
    {
        /// <summary>
        /// 数据源ID，优选中用到的数据源代称
        /// </summary>
        [XmlAttribute("id")]
        public string ID { get; set; }
        /// <summary>
        /// 数据源编号
        /// </summary>
        [XmlAttribute("code")]
        public string Code { get; set; }
        /// <summary>
        /// 相同数据源序号
        /// </summary>
        [XmlAttribute("number")]
        public string Number { get; set; }
        /// <summary>
        /// 数据源中文名称
        /// </summary>
        [XmlAttribute("name")]
        public string Name { get; set; }
        /// <summary>
        /// 数据源选择顺序
        /// </summary>
        [XmlAttribute("sourcenumber")]
        public string SourceNumber { get; set; }

        private List<OptimziechildSourceData> _OptimziechildSources = new List<OptimziechildSourceData>();

        /// <summary>
        /// 子数据源集合
        /// </summary>
        [XmlElementAttribute("childsource")]
        public List<OptimziechildSourceData> OptimziechildSources
        {
            get { return _OptimziechildSources; }
            set { _OptimziechildSources = value; }
        }


    }

    /// <summary>
    /// 数据源配置子数据源
    /// </summary>
    [Serializable]
    [XmlRootAttribute("childsource")]
    public class OptimziechildSourceData
    {
        /// <summary>
        /// 数据源ID，优选中用到的数据源代称
        /// </summary>
        [XmlAttribute("id")]
        public string ID { get; set; }
        /// <summary>
        /// 数据源编号
        /// </summary>
        [XmlAttribute("code")]
        public string Code { get; set; }

    }

    /// <summary>
    /// 数据源配置集合
    /// </summary>
    [Serializable]
    [XmlRootAttribute("sourcedatadefine", IsNullable = false)]
    public class OptimizeDataSourceConfig
    {
        private List<OptimizeFactData> _OptimizeFactDatas = new List<OptimizeFactData>();
        /// <summary>
        /// 数据源配置集合
        /// </summary>
        [XmlElementAttribute("sourcedata")]
        public List<OptimizeFactData> OptimizeFactDatas
        {
            get { return _OptimizeFactDatas; }
            set { _OptimizeFactDatas = value; }
        }
    }
}
